(global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/center/center" ], {
    "1cfe": function(e, t, n) {},
    "2a2a": function(e, t, n) {
        "use strict";
        var i = n("1cfe");
        n.n(i).a;
    },
    "3c2a": function(e, t, n) {
        "use strict";
        n.r(t);
        var i = n("a368"), o = n("6ec8");
        for (var a in o) "default" !== a && function(e) {
            n.d(t, e, function() {
                return o[e];
            });
        }(a);
        n("2a2a");
        var r = n("f0c5"), s = Object(r.a)(o.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        t.default = s.exports;
    },
    "45a5": function(e, t, n) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("4e1e"), t(n("66fd")), e(t(n("3c2a")).default);
        }).call(this, n("543d").createPage);
    },
    "6ec8": function(e, t, n) {
        "use strict";
        n.r(t);
        var i = n("70fc"), o = n.n(i);
        for (var a in i) "default" !== a && function(e) {
            n.d(t, e, function() {
                return i[e];
            });
        }(a);
        t.default = o.a;
    },
    "70fc": function(e, t, n) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var i = n("b00d"), o = {
                data: function() {
                    return {
                        tel: "",
                        uploadServerUrl: "",
                        releaseColor: "linear-gradient(to right, #FFCD00,#FF9B00)",
                        nickname: "登录/注册",
                        avatarUrl: "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0",
                        teckname: "",
                        bottomColor: "",
                        vipcardId: 0,
                        graceFullLoading: !0,
                        isshare: 1,
                        showApply: 0,
                        items: [],
                        items2: [],
                        distributor: {},
                        isRelease: 2,
                        topHeight: 20,
                        perstatus: 0,
                        isrush: 2,
                        showLogin: !1,
                        showLogin2: !1,
                        adDots: !0,
                        currentAd: 0,
                        adsList: [],
                        attach: "",
                        bgImg: "",
                        vipset: {},
                        showVip: !1,
                        vippword: "",
                        iskefu: 2,
                        vipTime: "您还未办理会员,点击右侧绑定!",
                        company: "",
                        credit: 0,
                        showCredit: 1,
                        showShop: 1,
                        khCredit: 0,
                        k: 2,
                        isShowAdmin: 0,
                        centerIcon: [],
                        iconList: "",
                        cardname: "次卡",
                        tabBar: {},
                        currentCur: 0,
                        showDeal: !1,
                        agreeContent: "",
                        showTeckDeal: !1,
                        agreeTeckContent: "",
                        getcopy: "",
                        jionName: "",
                        isShowGaoKong: 2,
                        avatarFlag: false,
                        changAvatarFlag: false,
                        changNameFlag: false,
                        avatarUrlOld: '',
                        nicknameOld: ''
                    };
                },
                onLoad: function() {
                    "wx2285aa24a7029f46" != i.d && "wxcaad2fca5f5aeba1" != i.d || (this.isShowGaoKong = 1), 
                    "wx19ed4231110485bf" == i.d ? this.jionName = "加盟" : this.jionName = "入驻";
                    this.uploadServerUrl = this.$xRequest.url("entry/wxapp/v4uploadimg") + "perid=" + e.perid;
                },
                onReady: function() {
                    var e = this.$systemInfo.info().statusBarHeight;
                    this.topHeight = -e;
                },
                onShow: function() {
                    if (!this.avatarFlag) {
                      this.centerInfo();
                    }
                },
                methods: {
                    showDialogDeal: function() {
                        this.showDeal = !0;
                    },
                    closeDialogDeal: function() {
                        this.showDeal = !1;
                    },
                    showDialogTeckDeal: function() {
                        this.showTeckDeal = !0;
                    },
                    closeDialogTeckDeal: function() {
                        this.showTeckDeal = !1;
                    },
                    toCredit: function() {
                        e.navigateTo({
                            url: "../shop/shop"
                        });
                    },
                    onChooseAvatar: function(e) {
                        console.log("aaaaaaa")
                        console.log(e)
                        this.avatarUrl = e.detail.avatarUrl;
                        this.changAvatarFlag = true
                    },
                    onChangeNickName: function(e) {
                        console.log("input nickname______________________")
                        this.nickname = e.detail.value
                        this.changNameFlag = true
                        console.log(this.nickname)
                    },
                    showDialog1: function() {
                        this.showVip = !0;
                    },
                    closeDialog1: function() {
                        this.showVip = !1;
                    },
                    confirmVip: function() {
                        var t = this;
                        if (!this.vippword) return e.showToast({
                            icon: "none",
                            title: "请输入卡密"
                        }), !1;
                        e.showLoading({
                            mask: !0,
                            title: "提交中"
                        });
                        var n = this.$xSign.sign("u9vip");
                        this.$xRequest.request({
                            url: "entry/wxapp/u9vip",
                            data: {
                                xgsign: n,
                                op: "ids",
                                key: this.vippword
                            },
                            complete: function(n) {
                                t.showVip = !1, t.vippword = "", e.hideLoading(), e.showToast({
                                    icon: "none",
                                    title: n.data.message
                                }), t.centerInfo();
                            }
                        });
                    },
                    adsChange: function(e) {
                        var t = e.detail.current;
                        this.currentAd = t;
                    },
                    toUrl: function(t) {
                        var n = t.currentTarget.dataset.urltype;
                        if (1 == n) e.navigateTo({
                            url: t.currentTarget.dataset.url
                        }); else if (2 == n) wx.navigateToMiniProgram({
                            appId: t.currentTarget.dataset.mini,
                            path: t.currentTarget.dataset.url,
                            fail: function(t) {
                                e.showToast({
                                    title: "无法打开小程序",
                                    mark: !0,
                                    icon: "none",
                                    duration: 1200
                                });
                            }
                        }); else if (3 == n) {
                            var i = encodeURIComponent(t.currentTarget.dataset.url), o = t.currentTarget.dataset.title;
                            e.navigateTo({
                                url: "/xg_o2o/index/index_weburl?url=" + i + "&title=" + o
                            });
                        }
                    },
                    centerInfo: function() {
                        var t = this, n = this.$xSign.sign("v4center");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4center",
                            data: {
                                xgsign: n
                            },
                            success: function(n) {
                                var i = JSON.parse(t.$Decrypt(n.data.data));
                                console.log("dddddddddddd")
                                console.log(t.avatarUrl)
                                console.log(n.data)
                                console.log(i)
                                
                                0 == n.data.errno && (t.iskefu = i.iskefu, i.releaseColor && (t.releaseColor = i.releaseColor), 
                                t.bgImg = i.bgimg, t.vipset = i.vipset, t.graceFullLoading = !1, t.tel = i.tel, 
                                t.bottomColor = i.color, t.nickname = i.nickname, t.vipcardId = i.vipid, t.company = i.company, t.avatarUrl = i.avatarUrl,
                                t.isshare = i.share, t.showApply = i.showApply, t.items = i.item, t.items2 = i.item2, 
                                t.teckname = i.teckname, t.isRelease = i.isrelease, t.distributor = i.distributor, 
                                t.perstatus = i.personnelstatus, t.isrush = i.isrush, t.attach = i.attach, t.adsList = i.ads, 
                                t.adDots = t.adsList.length > 1, t.vipTime = i.vipTime, t.showCredit = i.showcredit, 
                                t.showShop = i.showshop, t.credit = i.credit, t.isShowAdmin = i.isShowAdmin, t.centerIcon = i.center, 
                                t.iconList = i.iconimg, t.cardname = i.cardname, e.getStorageSync("authorize"), 
                                t.tabBar = i.tabbar, t.currentCur = i.currentCur, t.agreeContent = i.deal, t.agreeTeckContent = i.personnelset, 
                                i.nickname && "登录/注册" != i.nickname || (t.showLogin = !0) || (t.showLogin2 = !0));
                                console.log("ffffffffff")
                                console.log(t.avatarUrl)
                            },
                            fail: function(e) {
                                t.graceFullLoading = !1;
                            }
                        });
                    },
                    closeDialogLogin: function() {
                        e.setStorageSync("authorize", "refuse"), this.showLogin = !1, this.showLogin2 = !1;
                        this.avatarFlag = false;
                    },
                    // 去授权
                    confirmLogin: function() {
                        this.showLogin = 0;
                        this.showLogin2 = !0;
                        this.avatarUrlOld = this.avatarUrl;
                        this.nicknameOld = this.nickname;
                    },
                    // 最后保存新的头像与昵称
                    confirmLogin2: function() {
                        var ee = this;

                        if (ee.avatarUrl == ee.avatarUrlOld && ee.nickname == ee.nicknameOld) {
                            e.showToast({
                                title: "头像和昵称没有发生变化！",
                                icon: "none"
                            });
                            return false;
                        }

                        this.closeDialogLogin();
                        var tt = this.$xSign.sign("v4getopenid");

                        // 如果没有重新选头像
                        if (ee.avatarUrl == ee.avatarUrlOld) {
                              var userInfo2  = {
                                avatarUrl: ee.avatarUrl,
                                nickName: ee.nickname,
                                province: ""
                            };
                            ee.$xRequest.request({
                                url: "entry/wxapp/v4getopenid",
                                data: {
                                    userinfo: userInfo2,
                                    xgsign: tt,
                                    op: "userprofile"
                                },
                                success: function(t) {
                                    ee.centerInfo();
                                },
                                fail: function(t) {
                                  console.log(t)
                                }
                            });
                        } else {
                            e.uploadFile({
                                url: ee.uploadServerUrl,
                                filePath: ee.avatarUrl,
                                name: "img",
                                success: function(t) {
                                    if ("ok" == (t = JSON.parse(t.data)).status) {
                                        console.log(ee)
                                        ee.avatarUrl = t.data
                                        console.log(ee.avatarUrl)
                                        console.log(ee.nickname)
                                        var userInfo2  = {
                                            avatarUrl: ee.avatarUrl,
                                            nickName: ee.nickname,
                                            province: ""
                                        };
                                        ee.$xRequest.request({
                                            url: "entry/wxapp/v4getopenid",
                                            data: {
                                                userinfo: userInfo2,
                                                xgsign: tt,
                                                op: "userprofile"
                                            },
                                            success: function(t) {
                                                ee.centerInfo();
                                            },
                                            fail: function(t) {
                                              console.log(t)
                                            }
                                        });
                                    }
                                },
                                fail: function(t) {
                                    console.log("shang chuan tupian____________________2")
                                    e.showToast({
                                        title: "头像上传失败，请稍候重试",
                                        icon: "none"
                                    });
                                }
                            })
                          }
                    },
                    toOrder: function(t) {
                        e.navigateTo({
                            url: "/xg_o2o/order/order?ordernum=" + t
                        });
                    },
                    makePhoneCall: function() {
                        e.makePhoneCall({
                            phoneNumber: this.tel
                        });
                    },
                    login: function() {
                        this.showLogin = !0;
                    },
                    copyId: function() {
                        e.setClipboardData({
                            data: this.vipcardId,
                            success: function() {
                                console.log("success");
                            }
                        });
                    }
                }
            };
            t.default = o;
        }).call(this, n("543d").default);
    },
    a368: function(e, t, n) {
        "use strict";
        n.d(t, "b", function() {
            return o;
        }), n.d(t, "c", function() {
            return a;
        }), n.d(t, "a", function() {
            return i;
        });
        var i = {
            gracePage: function() {
                return n.e("graceUI/components/gracePage").then(n.bind(null, "1915"));
            },
            graceFullLoading: function() {
                return n.e("graceUI/components/graceFullLoading").then(n.bind(null, "7669"));
            },
            graceDialog: function() {
                return n.e("graceUI/components/graceDialog").then(n.bind(null, "8d15"));
            },
            divider: function() {
                return n.e("components/divider/divider").then(n.bind(null, "bdb7"));
            },
            uniSwiperDot: function() {
                return n.e("uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot").then(n.bind(null, "7f4a"));
            },
            graceBoxBanner: function() {
                return n.e("graceUI/components/graceBoxBanner").then(n.bind(null, "b5e7"));
            },
            xmgTabBar: function() {
                return n.e("components/xmgTabBar/xmgTabBar").then(n.bind(null, "cfe5"));
            }
        }, o = function() {
            var e = this, t = (e.$createElement, e._self._c, Object.keys(e.tabBar));
            e.$mp.data = Object.assign({}, {
                $root: {
                    g0: t
                }
            });
        }, a = [];
    }
}, [ [ "45a5", "common/runtime", "common/vendor" ] ] ]);